<template>
  <div class="content">
    <CloudForm :data="forms" v-model="menus" ref='cloud' />
  </div>
</template>
<script type="text/javascript">
import forms from './form';
export default {
  data() {
    return {
      forms,
      menus: {}
    };
  },
  /**
   * 计算属性
   * @type {Object}
   */
  computed: {

  },
  /**
   * 数据监听
   * @type {Object}
   */
  watch: {

  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  async mounted() {

  },
  /**
   * 页面方法
   * @type {Object}
   */
  methods: {
    affirm(e) {
      let { handleCancel } = e;
      this.$refs.cloud.submit().then(data => {
        console.log('data', data);
        this.$cloud.multi().add(data).then(res => {
          console.log('提交返回值', res);
          handleCancel();
        }).catch(error => {
          this.$Message.error(error.data.msg || error.msg || '网络超时');
        });
      }).catch(error => {
        console.log('error', error);
      });
    }
  }
};

</script>
<style type="text/css" scoped="true">
</style>
